Integrand size = 23, antiderivative size = 50 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {x}{a-b}+\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{(a-b) \sqrt {b} f} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3751, 492, 209, 211} \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {b} f (a-b)}-\frac {x}{a-b} \]
[In]
[Out]
Rule 209
Rule 211
Rule 492
Rule 3751
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f}+\frac {a \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f} \\ & = -\frac {x}{a-b}+\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{(a-b) \sqrt {b} f} \\ \end{align*}
Time = 0.03 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.98 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\arctan (\tan (e+f x))-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {b}}}{-a f+b f} \]
[In]
[Out]
Time = 0.09 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00
method | result | size |
derivativedivides | \(\frac {-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}+\frac {a \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}}{f}\) | \(50\) |
default | \(\frac {-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}+\frac {a \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}}{f}\) | \(50\) |
risch | \(-\frac {x}{a -b}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{2 b \left (a -b \right ) f}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{2 b \left (a -b \right ) f}\) | \(121\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 181, normalized size of antiderivative = 3.62 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\left [-\frac {4 \, f x + \sqrt {-\frac {a}{b}} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} - 4 \, {\left (b^{2} \tan \left (f x + e\right )^{3} - a b \tan \left (f x + e\right )\right )} \sqrt {-\frac {a}{b}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right )}{4 \, {\left (a - b\right )} f}, -\frac {2 \, f x - \sqrt {\frac {a}{b}} \arctan \left (\frac {{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt {\frac {a}{b}}}{2 \, a \tan \left (f x + e\right )}\right )}{2 \, {\left (a - b\right )} f}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (37) = 74\).
Time = 1.24 (sec) , antiderivative size = 252, normalized size of antiderivative = 5.04 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {- x + \frac {\tan {\left (e + f x \right )}}{f}}{a} & \text {for}\: b = 0 \\\frac {x}{b} & \text {for}\: a = 0 \\\frac {f x \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {f x}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} - \frac {\tan {\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text {for}\: a = b \\\frac {x \tan ^{2}{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text {for}\: f = 0 \\\frac {a \log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a b f \sqrt {- \frac {a}{b}} - 2 b^{2} f \sqrt {- \frac {a}{b}}} - \frac {a \log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a b f \sqrt {- \frac {a}{b}} - 2 b^{2} f \sqrt {- \frac {a}{b}}} - \frac {2 b f x \sqrt {- \frac {a}{b}}}{2 a b f \sqrt {- \frac {a}{b}} - 2 b^{2} f \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.94 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\frac {a \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a - b\right )}} - \frac {f x + e}{a - b}}{f} \]
[In]
[Out]
none
Time = 0.59 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.28 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {\frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} a}{\sqrt {a b} {\left (a - b\right )}} - \frac {f x + e}{a - b}}{f} \]
[In]
[Out]
Time = 11.56 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.70 \[ \int \frac {\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {2\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a^2\,b+2\,b^3\right )+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )}{{\left (2\,a-2\,b\right )}^2}}{a\,b\,\left (2\,a-2\,b\right )}\right )}{f\,\left (2\,a-2\,b\right )}-\frac {\mathrm {atanh}\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a\,b}}{a}\right )\,\sqrt {-a\,b}}{f\,\left (a\,b-b^2\right )} \]
[In]
[Out]